The present invention relates to an image data compression device and an encoder.
Moving Picture Experts Group Phase 4 (MPEG-4) has been standardized as a general-purpose coding method for multimedia information such as image data of a still image or a moving image and sound data. A recent portable instrument realizes encoding and decoding of image data conforming to the MPEG-4 standard, and can perform moving image reproduction and transmission/reception through a network.
In the MPEG-4 standard, compressed data obtained by encoding image data of a moving image must be generated at a constant rate. However, when compressing image data of a moving image, compression efficiency changes to a large extent depending on the type of image data. MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999 (E) Annex L) describes a rate control method for generating compressed data at a constant rate by controlling the amount of code to be generated so that such a change is within a predetermined range.
When performing MPEG-4 encode (compression) processing, a series of processing may be entirely performed by hardware. However, since this increases the circuit scale, it is difficult to achieve a reduction of size when integrating the circuits in an IC (semiconductor device or integrated circuit). In particular, a portable instrument such as a portable telephone cannot satisfy a demand for a reduction of the size of the instrument.
A series of encode processing may be entirely performed by using software.
However, this increases the load imposed on a central processing unit (CPU) which processes the software. Therefore, the time necessary for the CPU to perform another processing is limited, whereby the performance of an instrument provided with the CPU is decreased. Moreover, the processing time of the CPU is increased, whereby power consumption is increased. In particular, a portable instrument such as a portable telephone cannot satisfy a demand for a reduction of power consumption in order to maintain battery life.
Therefore, a series of encode processing may be allocated between hardware and software. However, as a result of studies conducted by the present inventors, it was found that the rate control method disclosed in MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999 (E) Annex L) cannot be performed when optimizing the allocation between hardware and software for a series of encode processing. Therefore, optimization of allocation of image data compression processing between hardware and software and generation of compressed data at a constant rate cannot achieved in combination.